package com.hibiscusking.org.enm;

import jdk.internal.dynalink.beans.StaticClass;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ShopState {
    REJECT(-1,"驳回"),
    WAIT_EXAMINE(0,"待审核"),
    REVIEWED(1,"审核通过"),
    ACTIVATION(2,"已激活");
    int code;
    String stateType;
    public static String shopStateType(int code) {
        ShopState[] states = ShopState.values();
        ShopState shopState = Arrays.stream(states).filter(state -> state.getCode() == code)
                .findAny().orElse(null);
        return null == shopState?"":shopState.getStateType();
    }
}
